import { csDevelopmentSetting } from '../types'
import { Local } from '/@/utils/storage'


const CSDEV_SETTING_KEY = 'csdev_setting'

/**
 * 开发者工具配置
 */
export let setting: csDevelopmentSetting = Local.get(CSDEV_SETTING_KEY)
if (!setting) {
  setting = {
    auth: true
  }
}

/**
 * 保存配置
 * @param data csDevelopmentSetting
 */
export const save = (data: csDevelopmentSetting) => {
  setting = data
  Local.set(CSDEV_SETTING_KEY, data)
}
